/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package servlets;

import databeans.MateriaAlumnoDataBean;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Emerson
 */
public class EliminarMateriaAlumno extends HttpServlet {
   

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        try {
           String carnet = request.getParameter("carnet");
           String codMateria = request.getParameter("codmateria");
           MateriaAlumnoDataBean mad = new MateriaAlumnoDataBean();
           mad.borrarMateriaAlumno(carnet, codMateria);
           String urlAntes=request.getHeader("Referer");
           response.sendRedirect(urlAntes);
        } catch (Exception ex) {
            Logger.getLogger(EliminarMateriaAlumno.class.getName()).log(Level.SEVERE, null, ex);
        } finally { 
        }
    } 

   
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    } 

    
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

   
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
